/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.trick.admin.task;

import it.trick.admin.model.PageModel;
import it.trick.admin.service.PageService;
import javafx.concurrent.Service;
import javafx.concurrent.Task;

/**
 *
 * @author takahara
 */
public class GetPageModelTask extends Service<PageModel> {

    private String keyString;

    public void setup(String keyString) {
        this.keyString = keyString;
    }

    @Override
    protected Task createTask() {
        return new Task<PageModel>() {
            @Override
            protected PageModel call() throws Exception {

                return PageService.getPage(keyString);
            }
        };
    }
}
